package com.cloud.spring.demo.feign;

import com.cloud.spring.demo.entity.User;
import com.cloud.spring.demo.feign.fallback.EurekaClient2HystrixFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "eureka-client2", fallbackFactory = EurekaClient2HystrixFallbackFactory.class)
public interface EurekaClient2Feign {
    @GetMapping("getUser")
    User getUser(@RequestParam("id") int id);

    @PostMapping("getUserList")
    List<User> getUserList(@RequestBody User user);

    @PostMapping("saveUserList")
    List<User> saveUserList(@RequestBody List<User> user);
}
